define([ 'jquery', 'underscore', 'backbone', 'bootstrap','text!templates/IndexModuleTemplate.jst','BaseModule'],
		function($, _, Backbone, bt,IndexModuleTemplate,BaseModule) {
	
	var indexContext={};
    _.extend(indexContext,Backbone.Events);
	var IndexModule = Backbone.View.extend({
		template:_.template(IndexModuleTemplate),
		initialize:function(){
			Backbone.Events.on("shiftModule",this.open,this);
			this.searchView=new SearchView();
		},
		render:function(){
			this.$el.html(this.template({"tempId":"Base","data":null}));
			this.$('#SearchPanel').append(this.searchView.render().el);
			return this;
		},
		open:function(name){
			name == "index" ? this.$el.fadeIn(): this.$el.hide();
		}
	});
	
	var SearchView=Backbone.View.extend({
		tagName:"div",
		template:_.template(IndexModuleTemplate),
		initialize:function(){
			
		},
		render:function(){
			$(this.el).html(this.template({"tempId":"Search",data:null}));
			return this;
		}
	});
	var SearchModel=Backbone.Model.extend({
		
	});
	
	
	return IndexModule;
});